﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="arrange.aspx.cs" Inherits="AnyOffice.general.calendar.manage.arrange" %>

<%@ Register TagPrefix="cc1" Namespace="DataControls" Assembly="DataCalendar" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
	<HEAD>
		<title>arrange</title>
		<meta content="Microsoft Visual Studio .NET 7.1" name="GENERATOR">
		<meta content="C#" name="CODE_LANGUAGE">
		<meta content="JavaScript" name="vs_defaultClientScript">
		<meta content="http://schemas.microsoft.com/intellisense/ie5" name="vs_targetSchema">
		<script>
my_top=50;
my_left=50;

function my_note(CAL_ID)
{
  my_top+=25;
  my_left+=15;

  window.open("note.aspx?cal_id="+CAL_ID,"note_win"+CAL_ID,"height=200,width=250,status=0,toolbar=no,menubar=no,location=no,scrollbars=auto,top="+ my_top +",left="+ my_left +",resizable=no");
}

function My_Submit()
{
  document.Form1.submit();
}

function set_year(op)
{
  if(op==-1 && document.Form1.selectYear.selectedIndex==0)
     return;
  if(op==1 && document.Form1.selectYear.selectedIndex==(document.Form1.selectYear.options.length-1))
     return;
  document.Form1.selectYear.selectedIndex=document.Form1.selectYear.selectedIndex+op;

  My_Submit();
}

function set_mon(op)
{
  if(op==-1 && document.Form1.selectMonth.selectedIndex==0)
     return;
  if(op==1 && document.Form1.selectMonth.selectedIndex==(document.Form1.selectMonth.options.length-1))
     return;
  document.Form1.selectMonth.selectedIndex=document.Form1.selectMonth.selectedIndex+op;

  My_Submit();
}

		</script>
	</HEAD>
	<body class="bodycolor" topMargin="5">
		<form id="Form1" method="post" runat="server">
			<table border="0" width="100%" cellspacing="0" cellpadding="3" class="small">
				<tr>
					<td class="Big"><img src="/images/menu/calendar.gif" align="absMiddle"><span class="big3">
							日程安排</span>
					</td>
				</tr>
			</table>
			<div align="center" class="Big1">
				<!-------------- 年 ------------>
				<input type="button" value="〈" class="BigButton" title="上一年" onclick="set_year(-1);"><select name="YEAR" class="BigSelect" onchange="My_Submit();" id="selectYear" runat="server">
					<option value="2000">2000</option>
					<option value="2001">2001</option>
					<option value="2002">2002</option>
					<option value="2003">2003</option>
					<option value="2004">2004</option>
					<option value="2005">2005</option>
					<option value="2006">2006</option>
					<option value="2007">2007</option>
					<option value="2008">2008</option>
					<option value="2009">2009</option>
					<option value="2010">2010</option>
					<option value="2011">2011</option>
					<option value="2012">2012</option>
					<option value="2013">2013</option>
					<option value="2014">2014</option>
					<option value="2015">2015</option>
				</select><input type="button" value="〉" class="BigButton" title="下一年" onclick="set_year(1);">
				<b>年</b> 
				<!-------------- 月 ------------>
				<input type="button" value="〈" class="BigButton" title="上一月" onclick="set_mon(-1);"><select name="MONTH" class="BigSelect" onchange="My_Submit();" runat="server" id="selectMonth">
					<option value="1">01</option>
					<option value="2">02</option>
					<option value="3">03</option>
					<option value="4">04</option>
					<option value="5">05</option>
					<option value="6">06</option>
					<option value="7">07</option>
					<option value="8">08</option>
					<option value="9">09</option>
					<option value="10">10</option>
					<option value="11">11</option>
					<option value="12">12</option>
				</select><input type="button" value="〉" class="BigButton" title="下一月" onclick="set_mon(1);">
				<b>月</b> &nbsp;&nbsp;<input type="button" value="本月" class="BigButton" title="本月" onclick="location='arrange.aspx'">
			</div>
			<br>
			<cc1:datacalendar id="DataCalendar1" runat="server" ShowTitle="False" SelectionMode="Day" DayField="StartTime"
				Width="95%" BorderWidth="1px" BorderColor="Black" BorderStyle="Solid" EnableViewState="False" onselectionchanged="DataCalendar1_SelectionChanged">
				<TodayDayStyle BackColor="#FFED95"></TodayDayStyle>
				<OtherMonthDayStyle ForeColor="DarkGray" BackColor="LightGray" CssClass="TableData"></OtherMonthDayStyle>
				<TitleStyle Font-Bold="True" CssClass="TableHeader"></TitleStyle>
				<DayStyle Font-Size="15pt" Font-Names="sans-serif" ForeColor="Blue" Font-Bold="True" HorizontalAlign="Center" VerticalAlign="Top"
					CssClass="TableData"></DayStyle>
				<DayHeaderStyle CssClass="TableHeader"></DayHeaderStyle>
				<ItemTemplate>
					<table width="100%">
						<tr>
							<td align="left">
								<span style="font-size:12px">
									<%# DateTime.Parse(Container.DataItem["StartTime"].ToString()).ToString("t") %>
									-<%# DateTime.Parse(Container.DataItem["EndTime"].ToString()).ToString("t") %></span><br>
								<span style="font-size:12px;font-weight: bold">
									<%# (Convert.ToInt32(Container.DataItem["CalType"].ToString()) ==1)?"工作":"个人" %>
									:</span><a style="CURSOR: hand;font-size:12px;color:#0000ff" onclick='javascript:my_note(<%# Container.DataItem["CalId"] %>);' target="_blank">
									<%# Container.DataItem["Content"]!=DBNull.Value?Container.DataItem["Content"].ToString().Replace("\n","<br>"):""%>
									</a>
									<span style="font-size:12px">
									<%# (Container.DataItem["ManagerUserName"] != DBNull.Value) ? "<br>安排人：" + Container.DataItem["ManagerUserName"].ToString() : "" %>
									</span>
								
							</td>
						</tr>
					</table>
				</ItemTemplate>
				<NoEventsTemplate></NoEventsTemplate>
			</cc1:datacalendar></form>
	</body>
</HTML>
